/**
 * Created by Administrator on 2016/8/1.
 */
var a = false;
function testAnim(x) {
    $('.animationSandbox').addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
        $(this).removeClass(x + ' animated');
    });

};
function testAnim1(x) {
    $('.animationSandbox2').addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
        $(this).removeClass(x + ' animated');
    });
};
function testAnim2(x) {
    $('.animationSandbox3').addClass(x + ' animated').one('webkitAnimationEnd mozAnimationEnd MSAnimationEnd oanimationend animationend', function(){
        $(this).removeClass(x + ' animated');
    });
};

$(document).ready(function(){
    var anim = $('.js--animations').val();
    testAnim(anim);
    var anim1 =$('.right-animations').val();
    testAnim1(anim1);
    var anim2 =$('.bottom-animations').val();
    testAnim2(anim2);
});
$(window).scroll(function () {
    if(window.document.body.scrollTop <700){
        $('.xuanze1').css('opacity','0').css('transition','1s');
        $('.header-c').css('opacity','1').css('transition','1s');
        $('.xuanze2').css('opacity','0').css('transition','1s');
    }
    if(window.document.body.scrollTop >700 && window.document.body.scrollTop <1300){
        $('.xuanze1').css('opacity','1').css('transition','1s');
        $('.header-c').css('opacity','0').css('transition','1s');
        $('.xuanze2').css('opacity','0').css('transition','1s');

    }
    if(window.document.body.scrollTop >1300) {
        $('.xuanze2').css('opacity', '1').css('transition', '1s');
        $('.xuanze1').css('opacity', '0').css('transition', '1s');
        $('.header-c').css('opacity', '0').css('transition', '1s');
    }
    if(window.document.body.scrollTop == 1300){
        var anim = $('.js--animations').val();
        testAnim(anim);
        var anim1 =$('.right-animations').val();
        testAnim1(anim1);
        var anim2 =$('.bottom-animations').val();
        testAnim2(anim2);
    }
    if(window.document.body.scrollTop == 0){
        var anim = $('.js--animations').val();
        testAnim(anim);
        var anim1 =$('.right-animations').val();
        testAnim1(anim1);
        var anim2 =$('.bottom-animations').val();
        testAnim2(anim2);
    }
    if(window.document.body.scrollTop == 700){
        var anim = $('.js--animations').val();
        testAnim(anim);
        var anim1 =$('.right-animations').val();
        testAnim1(anim1);
        var anim2 =$('.bottom-animations').val();
        testAnim2(anim2);
    }

});



